home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gcc-2.1 / sun4.md / Makefile < prev    next >
Encoding:
Makefile  |  1992-05-12  |  60.0 KB  |  1,598 lines

  1. VPATH = ../dist
  2. # Makefile for GNU C compiler.
  3. #   Copyright (C) 1987, 1988, 1990, 1991 Free Software Foundation, Inc.
  4.  
  5. #This file is part of GNU CC.
  6.  
  7. #GNU CC is free software; you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation; either version 2, or (at your option)
  10. #any later version.
  11.  
  12. #GNU CC is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16.  
  17. #You should have received a copy of the GNU General Public License
  18. #along with GNU CC; see the file COPYING.  If not, write to
  19. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. # The targets for external use include:
  22. # all, doc, proto, install, install-cross, install-cross-rest,
  23. # uninstall, TAGS, mostlyclean, clean, distclean, realclean,
  24. # stage1, stage2, stage3, stage4.
  25.  
  26. # Suppress smart makes who think they know how to automake Yacc files
  27. .y.c:
  28.  
  29. .NOEXPORT: # This tells GNU Make version 3
  30.        # not to put all the variables in the environment.
  31.  
  32. # Variables that exist for you to override.
  33. # See below for how to change them for certain systems.
  34.  
  35. # Selection of languages to be made.
  36. LANGUAGES = c c++ objective-c proto
  37.  
  38. ALLOCA =
  39. ALLOCA_FLAGS = -S -Demacs
  40. ALLOCA_FINISH = as -o alloca.o alloca.s
  41.  
  42. # Various ways of specifying flags for compilations:  
  43. # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
  44. # BOOT_CFLAGS is the value of CFLAGS to pass
  45. # to the stage2 and stage3 compilations
  46. # XCFLAGS is used for most compilations but not when using the GCC just built.
  47. XCFLAGS =
  48. CFLAGS = -g
  49. BOOT_CFLAGS = -O $(CFLAGS)
  50. # These exists to be overridden by the x-* and t-* files, respectively.
  51. X_CFLAGS =
  52. T_CFLAGS =
  53.  
  54. X_CPPFLAGS =
  55. T_CPPFLAGS =
  56.  
  57. CC = cc
  58. BISON = bison
  59. BISONFLAGS =
  60. AR = ar
  61. OLDAR_FLAGS = qc
  62. AR_FLAGS = rc
  63. SHELL = /bin/sh
  64. # on sysV, define this as cp.
  65. INSTALL = install -c
  66. # These permit overriding just for certain files.
  67. INSTALL_PROGRAM = $(INSTALL)
  68. INSTALL_DATA = $(INSTALL)
  69. SYMLINK = ln -s
  70.  
  71. # Define this as & to perform parallel make on a Sequent.
  72. # Note that this has some bugs, and it seems currently necessary 
  73. # to compile all the gen* files first by hand to avoid erroneous results.
  74. P =
  75.  
  76. # How to invoke ranlib.
  77. RANLIB = ranlib
  78. # Test to use to see whether ranlib exists on the system.
  79. RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
  80.  
  81. # Compiler to use for compiling libgcc1.a.
  82. # OLDCC should not be the GNU C compiler,
  83. # since that would compile typical libgcc1.a functions such as mulsi3
  84. # into infinite recursions.
  85. OLDCC = cc
  86.  
  87. # CFLAGS for use with OLDCC, for compiling libgcc1.a.
  88. # NOTE: -O does not work on some Unix systems!
  89. CCLIBFLAGS = -O
  90.  
  91. # Version of ar to use when compiling libgcc1.a.
  92. OLDAR = ar
  93.  
  94. # The GCC to use for compiling libgcc2.a.  Usually the one we just built.
  95. # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
  96. GCC_FOR_TARGET = ./gcc
  97.  
  98. # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  99. # It omits XCFLAGS, and specifies -B./.
  100. GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -B./
  101.  
  102. # Special flags for compiling enquire.
  103. # We disable optimization to make floating point more reliable.
  104. ENQUIRE_CFLAGS = -DNO_SC -DNO_MEM -DNO_STDDEF -O0
  105. ENQUIRE_LDFLAGS = $(LDFLAGS)
  106.  
  107. # Tools to use when building a cross-compiler.
  108. # These are used because `configure' appends `cross-make'
  109. # to the makefile when making a cross-compiler.
  110.  
  111. TARGET_TOOLPREFIX = $(tooldir)/bin/
  112. AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
  113. AR_FOR_TARGET_FLAGS = rc
  114. RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
  115. RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
  116. CROSS_TOOLS =
  117.  
  118. target=sparc-sun-sunos4.1
  119. xmake_file=../Makefile.in
  120. tmake_file=../Makefile.in
  121. version=`awk '{printf "%s", substr ($$4, 2, length ($$4) - 3); }' $(srcdir)/version.c`
  122.  
  123. # Directory where sources are, from where we are.
  124. srcdir = ../dist
  125. # Common prefix for installation directories.
  126. # NOTE: This directory must exist when you start installation.
  127. prefix = /usr/local
  128. # Directory in which to put host dependent programs and libraries
  129. exec_prefix = $(prefix)
  130. # Directory in which to put the executable for the command `gcc'
  131. bindir = $(exec_prefix)/bin
  132. # Directory in which to put the directories used by the compiler.
  133. libdir = $(exec_prefix)/lib
  134. # Directory in which the compiler finds executables, libraries, etc.
  135. libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
  136. # Extension (if any) to put in installed man-page filename.
  137. manext = .1
  138. # Directory in which to put man pages.
  139. mandir = $(prefix)/man/man1
  140. # Directory in which to find other cross-compilation tools and headers.
  141. # Used in install-cross.
  142. tooldir = $(prefix)/$(target)
  143.  
  144. # Additional system libraries to link with.
  145. CLIB=
  146.  
  147. # Change this to a null string if obstacks are installed in the
  148. # system library.
  149. OBSTACK=obstack.o
  150.  
  151. # Specify the rule for actually making libgcc1.a.
  152. # The value may be empty; that means to do absolutely nothing
  153. # with or for libgcc1.a.
  154. LIBGCC1 = libgcc1.a
  155.  
  156. # Specify the rule for actually making libgcc2.a.
  157. LIBGCC2 = libgcc2.a
  158.  
  159. # Options to use when compiling libgcc2.a.
  160. # -g1 causes output of debug info only for file-scope entities.
  161. # we use this here because that should be enough, and also
  162. # so that -g1 will be tested.
  163. LIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS) -g1
  164.  
  165. # List of extra executables that should be compiled for this target machine
  166. # that are used for compiling from source code to object code.
  167. # The rules for compiling them should be in the t-* file for the machine.
  168. EXTRA_PASSES =
  169.  
  170. # Like EXTRA_PASSES, but these are used when linking.
  171. EXTRA_PROGRAMS = 
  172.  
  173. # List of extra object files that should be compiled for this target machine.
  174. # The rules for compiling them should be in the t-* file for the machine.
  175. EXTRA_PARTS =
  176.  
  177. # List of extra object files that should be compiled and linked with
  178. # compiler proper (cc1, cc1obj, cc1plus).
  179. EXTRA_OBJS =
  180.  
  181. # List of extra C and assembler files to add to libgcc1.a.
  182. # Assembler files should have names ending in `.asm'.
  183. LIB1FUNCS_EXTRA = 
  184.  
  185. # List of extra C and assembler files to add to libgcc2.a.
  186. # Assembler files should have names ending in `.asm'.
  187. LIB2FUNCS_EXTRA = 
  188.  
  189. # Program to convert libraries.
  190. LIBCONVERT = 
  191.  
  192. # Control whether header files are installed.
  193. # We will change this to install-fixincludes eventually.
  194. # It would be useful for people to try this now.
  195. INSTALL_HEADERS=install-headers
  196.  
  197. # Select which version of fixincludes to use (I.E. regular versus SVR4)
  198. FIXINCLUDES=fixincludes
  199.  
  200. # List of things which should already be built whenever we try to use gcc
  201. # to compile anything (without linking).
  202. GCC_PASSES=gcc cc1 cpp $(EXTRA_PASSES)
  203.  
  204. # List of things which should already be built whenever we try to use gcc
  205. # to link anything.
  206. GCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(EXTRA_PARTS)
  207.  
  208. # Change this to empty to prevent installing limits.h.
  209. # Actually, this currently has no effect,
  210. # and if that causes no problems, it can be deleted.
  211. # Otherwise, it must be replaced so as to control
  212. # the actions of install-limits-h.
  213. LIMITS_H = limits.h
  214.  
  215. # Directory to link to, when using the target `maketest'.
  216. DIR = ../gcc
  217.  
  218. # Flags to use when cross-building GCC.
  219. # Prefix to apply to names of object files when using them
  220. # to run on the machine we are compiling on.
  221. HOST_PREFIX=
  222. # Prefix to apply to names of object files when compiling them
  223. # to run on the machine we are compiling on.
  224. # The default for this variable is chosen to keep these rules 
  225. # out of the way of the other rules for compiling the same source files.
  226. HOST_PREFIX_1=loser-
  227. HOST_CC=$(CC)
  228. HOST_CFLAGS=$(ALL_CFLAGS)
  229. HOST_CLIB=$(CLIB)
  230. HOST_LDFLAGS=$(LDFLAGS)
  231. HOST_CPPFLAGS=$(ALL_CPPFLAGS)
  232. HOST_ALLOCA=$(ALLOCA)
  233. HOST_MALLOC=$(MALLOC)
  234. HOST_OBSTACK=$(OBSTACK)
  235.  
  236. # Choose the real default target.
  237. ALL=all.internal
  238.  
  239. # Choose the real install target.
  240. INSTALL_TARGET=install-native
  241.  
  242. # End of variables for you to override.
  243.  
  244. # Definition of `all' is here so that new rules inserted by sed
  245. # do not specify the default target.
  246. # The real definition is under `all.internal' (for native compilers)
  247. # or `all.cross' (for cross compilers).
  248. all: all.indirect
  249.  
  250. # sed inserts variable overrides after the following line.
  251. ####
  252.  
  253. # Now figure out from those variables how to compile and link.
  254.  
  255. all.indirect: $(ALL)
  256.  
  257. INTERNAL_CFLAGS = $(CROSS)
  258.  
  259. # This is the variable actually used when we compile.
  260. ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
  261.  
  262. # Likewise.
  263. ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
  264.  
  265. # Even if ALLOCA is set, don't use it if compiling with GCC.
  266. USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo ${ALLOCA} ;; esac `
  267. USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
  268. USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
  269. USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
  270.  
  271. # Dependency on obstack, alloca, malloc or whatever library facilities
  272. # are not installed in the system libraries.
  273. # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
  274. LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
  275.  
  276. # Likewise, for use in the tools that must run on this machine
  277. # even if we are cross-building GCC.
  278. # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
  279. HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
  280.  
  281. # How to link with both our special library facilities
  282. # and the system's installed libraries.
  283. LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
  284.  
  285. # Likewise, for use in the tools that must run on this machine
  286. # even if we are cross-building GCC.
  287. HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
  288.         $(HOST_CLIB)
  289.  
  290. HOST_RTL = $(HOST_PREFIX)rtl.o
  291. HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
  292.  
  293. # Specify the directories to be searched for header files.
  294. # Both . and srcdir are used, in that order,
  295. # so that tm.h and config.h will be found in the compilation
  296. # subdirectory rather than in the source directory.
  297. INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
  298. SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
  299.  
  300. # Always use -I$(srcdir)/config when compiling.
  301. .c.o:
  302.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
  303.  
  304. # This tells GNU make version 3 not to export all the variables
  305. # defined in this file into the environment.
  306. .NOEXPORT:
  307.  
  308. # Lists of files for various purposes.
  309.  
  310. # A list of all the language-specific executables.
  311. COMPILERS = cc1 cc1plus cc1obj
  312.  
  313. # Language-specific object files for C.
  314. C_OBJS = c-parse.o c-lang.o \
  315.    c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o
  316.  
  317. # Language-specific object files for Objectionable C.
  318. OBJC_OBJS = objc-parse.o objc-actions.o \
  319.    c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o
  320.  
  321. # Language-specific object files for C++.
  322. CPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \
  323.    cp-typeck.o cp-type2.o cp-tree.o cp-ptree.o \
  324.    cp-cvt.o cp-search.o cp-lex.o cp-gc.o cp-call.o \
  325.    cp-class.o cp-init.o cp-method.o cp-except.o \
  326.    cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \
  327.    $(CPLUS_INPUT) cp-spew.o c-common.o
  328.  
  329. # Language-independent object files.
  330. OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
  331.  function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
  332.  rtl.o print-rtl.o rtlanal.o emit-rtl.o \
  333.  dbxout.o sdbout.o dwarfout.o xcoffout.o \
  334.  integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
  335.  regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \
  336.  insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
  337.  insn-recog.o insn-extract.o insn-output.o insn-emit.o \
  338.  insn-attrtab.o aux-output.o getpwd.o $(EXTRA_OBJS)
  339.  
  340. # GEN files are listed separately, so they can be built before doing parallel
  341. #  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
  342. #  them before rtl.o is compiled.
  343. GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
  344.  
  345. # Files to be copied away after each stage in building.
  346. STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
  347.  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
  348.  insn-attr.h insn-attrtab.c \
  349.  stamp-flags stamp-config stamp-codes \
  350.  stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
  351.  stamp-attr stamp-attrtab \
  352.  genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
  353.  genattrtab genattr \
  354.  $(GCC_PASSES) $(EXTRA_PARTS) gcc-cross cccp cc1plus cc1obj enquire \
  355.  protoize unprotoize specs collect2
  356.  
  357. # Members of libgcc1.a.
  358. LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
  359.    _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
  360.    _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
  361.    _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
  362.    _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
  363.    _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
  364.    _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
  365.  
  366. # Library members defined in libgcc2.c.
  367. LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
  368.      _lshrdi3 _lshldi3 _ashldi3 _ashrdi3  \
  369.     _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
  370.     _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
  371.     _varargs _eprintf _builtin_new _builtin_New _builtin_del \
  372.     _bb _shtab _clear_cache _trampoline __main _exit
  373.  
  374. # Header files that are made available under the same name
  375. # to programs compiled with gcc.
  376. USER_H = assert.h va-hp800.h va-i860.h va-mips.h va-pyr.h va-sparc.h \
  377.     va-spur.h va-m88k.h proto.h
  378.  
  379. # All the header files that are installed for users from GCC itself.
  380. INSTALLED_H = float.h stddef.h stdarg.h varargs.h $(USER_H) limits.h
  381.  
  382. # The files that "belong" in CONFIG_H are deliberately omitted
  383. # because having them there would not be useful in actual practice.
  384. # All they would do is cause complete recompilation every time
  385. # one of the machine description files is edited.
  386. # That may or may not be what one wants to do.
  387. # If it is, rm *.o is an easy way to do it.
  388. # CONFIG_H = config.h tm.h
  389. CONFIG_H =
  390. RTL_H = rtl.h rtl.def machmode.h machmode.def
  391. TREE_H = tree.h real.h tree.def machmode.h machmode.def
  392. CPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
  393.  
  394. # Avoid a lot of time thinking about remaking Makefile.in and *.def.
  395. .SUFFIXES: .in .def
  396.  
  397. Makefile: $(srcdir)/Makefile.in $(srcdir)/configure \
  398.    $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file)
  399.     sh config.status
  400.  
  401. all.internal: start.encap rest.encap
  402. # This is what to compile if making a cross-compiler.
  403. all.cross: native gcc-cross
  404. # This is what must be made before installing GCC and converting libraries.
  405. start.encap: native gcc $(LIBGCC1_TARGET)
  406. # Use this to make a GCC that will be used only to recompile GCC.
  407. for-bootstrap: start.encap libgcc.a
  408. # These can't be made, with COFF encapsulation, until after GCC can run.
  409. rest.encap: libgcc.a float.h  $(EXTRA_PARTS)
  410. # This is what is made with the host's compiler
  411. # whether making a cross compiler or not.
  412. native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS)
  413.  
  414. # Define the names for selecting languages in LANGUAGES.
  415. C c: cc1
  416. C++ c++: cc1plus
  417. OBJC objc: cc1obj
  418. OBJECTIVE-C objective-c: cc1obj
  419. PROTO: proto
  420.  
  421. # Really, really stupid make features, such as SUN's KEEP_STATE, may force
  422. # a target to build even if it is up-to-date.  So we must verify that
  423. # config.status does not exist before failing.
  424. config.status:
  425.     @if [ ! -f config.status ] ; then \
  426.       echo You must configure gcc.  Look at the INSTALL file for details.; \
  427.       false; \
  428.     else \
  429.       true; \
  430.     fi
  431.  
  432. compilations: ${OBJS}
  433.  
  434. gcc: gcc.o version.o $(LIBDEPS)
  435.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
  436. # Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
  437.     mv -f gccnew gcc
  438. # Dump a specs file to make -B./ read these specs over installed ones
  439.     ./gcc -dumpspecs > specs
  440.  
  441. # We do want to create an executable named `gcc', so we can use it to
  442. # compile libgcc2.a.
  443. # Also create gcc-cross, so that install-common will install properly.
  444. gcc-cross: gcc
  445.     cp gcc gcc-cross
  446.  
  447. cc1:$(P) $(C_OBJS) $(OBJS) $(LIBDEPS)
  448.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
  449.  
  450. cc1plus:$(P) $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
  451.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
  452.  
  453. cc1obj:$(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
  454.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(LIBS)
  455.  
  456. float.h: enquire
  457.     -./enquire -f > tmp-float.h
  458.     mv tmp-float.h float.h
  459.  
  460. # Used to compile enquire with standard cc, but have forgotten why.
  461. # Let's try with GCC.
  462. enquire: enquire.o $(GCC_PARTS)
  463.     $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
  464. enquire.o: $(srcdir)/enquire.c $(GCC_PASSES)
  465.     -cp $(srcdir)/enquire.c . > /dev/null 2>&1
  466. # Breaking this line caused a problem with one version of GNU make.
  467.     $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c enquire.c
  468.  
  469. # Build libgcc.a.
  470. # This is done in two parts because some functions, in libgcc1.c,
  471. # must be compiled with something other than gcc,
  472. # while the rest, in libgcc2.c, must be compiled with gcc.
  473. # That means we can't do libgcc2.c until after gcc, cc1, etc.
  474.  
  475. # Use this as value of LIBGCC1 to cause conversion to GNU library format.
  476. # LIBCONVERT should put its output in libgcc1.conv.
  477. libgcc1.conv: libgcc1.a
  478.     $(LIBCONVERT) libgcc1.a libgcc1.conv
  479.  
  480. # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
  481. # Make an empty file instead.
  482. libgcc1.null: $(CROSS_TOOLS) $(GCC_PASSES)
  483.     echo "__foo () {}" > dummy.c
  484.     $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
  485.     $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
  486.     rm -f dummy.o dummy.c
  487.  
  488. # Compile the library of arithmetic subroutines with the native compiler.
  489. # Don't compile it with gcc!
  490. # (That would cause most arithmetic functions to call themselves.)
  491. libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
  492.     -rm -f tmplibgcc1.a
  493. # Actually build it in tmplibgcc1.a, then rename at end,
  494. # so that libgcc1.a itself remains nonexistent if compilation is aborted.
  495. # -e causes any failing command to make this rule fail.
  496. # -e doesn't work in certain shells, so we test $$? as well.
  497.     set -e; \
  498.     for name in $(LIB1FUNCS); \
  499.     do \
  500.       echo $${name}; \
  501.       rm -f $${name}.o; \
  502.       $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
  503.       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  504.       mv libgcc1.o $${name}.o; \
  505.       $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
  506.       rm -f $${name}.o; \
  507.     done
  508. # Some shells crash when a loop has no items.
  509. # So make sure there is always at least one--`..'.
  510. # Then ignore it.
  511. # We don't use -e here because there are if statements
  512. # that should not make the command give up when the if condition is false.
  513. # Instead, we test for failure after each command where it matters.
  514.     -for file in .. $(LIB1FUNCS_EXTRA); \
  515.     do \
  516.       if [ x$${file} != x.. ]; then \
  517.         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  518.         echo $${name}; \
  519.         if [ $${name}.asm = $${file} ]; then \
  520.           cp $${file} $${name}.s; file=$${name}.s; \
  521.           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  522.         else true; fi; \
  523.         $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
  524.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  525.         $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
  526.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  527.         rm -f $${name}.[so]; \
  528.       else true; \
  529.       fi; \
  530.     done
  531.     mv tmplibgcc1.a libgcc1.a
  532.  
  533. # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
  534. # But recompiling cc1 should not force recompilation of libgcc2.a.
  535. # If you want to force recompilation, delete libgcc2.a.
  536. # Depend on install-cross-tools to make sure we set up properly 
  537. # to run the assembler before we try compiling anything.
  538. # install-cross-tools does nothing if not cross compiling.
  539. libgcc2.ready: $(GCC_PASSES) $(CROSS_TOOLS)
  540.     -if [ -f libgcc2.ready ] ; then \
  541.         true; \
  542.     else \
  543.         touch libgcc2.ready; \
  544.     fi
  545.  
  546. libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
  547.    longlong.h gbl-ctors.h config.status
  548. # Actually build it in tmplibgcc2.a, then rename at end,
  549. # so that libgcc2.a itself remains nonexistent if compilation is aborted.
  550.     -rm -f tmplibgcc2.a
  551. # -e causes any failing command to make this rule fail.
  552. # -e doesn't work in certain shells, so we test $$? as well.
  553.     set -e; \
  554.     for name in $(LIB2FUNCS); \
  555.     do \
  556.       echo $${name}; \
  557.       $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  558.           $(srcdir)/libgcc2.c -o $${name}.o; \
  559.       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  560.       $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
  561.       rm -f $${name}.o; \
  562.     done
  563. # Some shells crash when a loop has no items.
  564. # So make sure there is always at least one--`..'.
  565. # Then ignore it.
  566. # We don't use -e here because there are if statements
  567. # that should not make the command give up when the if condition is false.
  568. # Instead, we test for failure after each command where it matters.
  569.     -for file in .. $(LIB2FUNCS_EXTRA); \
  570.     do \
  571.       if [ x$${file} != x.. ]; then \
  572.         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  573.         echo $${name}; \
  574.         if [ $${name}.asm = $${file} ]; then \
  575.           cp $${file} $${name}.s; file=$${name}.s; \
  576.           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  577.         else true; fi; \
  578.         $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  579.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  580.         $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
  581.         rm -f $${name}.[so]; \
  582.       else true; \
  583.       fi; \
  584.     done
  585.     mv tmplibgcc2.a libgcc2.a
  586. # These lines were deleted from above the mv command
  587. # because ranlibing libgcc.a itself should suffice.
  588. #    -if [ x${HPUX_GAS} = x ] ; then \
  589. #      if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
  590. #    else true; fi
  591.  
  592. # Combine the various libraries into a single library, libgcc.a.
  593. libgcc.a: $(LIBGCC1) $(LIBGCC2)
  594.     -rm -rf tmplibgcc.a libgcc.a tmpcopy
  595.     mkdir tmpcopy
  596.     -if [ x$(LIBGCC1) != x ];            \
  597.     then (cd tmpcopy; $(AR) x ../$(LIBGCC1));    \
  598.     else true;                    \
  599.     fi
  600.     (cd tmpcopy; $(AR) x ../$(LIBGCC2))
  601.     (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
  602.     rm -rf tmpcopy
  603.     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
  604. # Actually build it in tmplibgcc.a, then rename at end,
  605. # so that libgcc.a itself remains nonexistent if compilation is aborted.
  606.     mv tmplibgcc.a libgcc.a
  607.  
  608.  
  609. # Compile two additional files that are linked with every program
  610. # linked using GCC on system V, for the sake of C++ constructors.
  611. crtbegin.o:    crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
  612.     $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \
  613.       -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
  614.  
  615. crtend.o:    crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
  616.     $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \
  617.       -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtend.o
  618.  
  619. # Compiling object files from source files.
  620.  
  621. # Note that dependencies on obstack.h are not written
  622. # because that file is not part of GCC.
  623. # Dependencies on gvarargs.h are not written
  624. # because all that file does, when not compiling with GCC,
  625. # is include the system varargs.h.
  626.  
  627. # C language specific files.
  628.  
  629. c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h input.h flags.h
  630.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
  631. $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
  632.     cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
  633.  
  634. c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
  635. c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
  636. c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
  637. c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \
  638.     input.h flags.h
  639. c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(TREE_H) c-tree.h flags.h
  640. c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
  641.  
  642. # C++ language specific files.
  643.  
  644. cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  645.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  646.   `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'`
  647.  
  648. $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y
  649.     @echo expect 30 shift/reduce conflicts and 14 reduce/reduce conflicts
  650.     cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y
  651.  
  652. cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \
  653.    $(srcdir)/cp-parse.h flags.h
  654. cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \
  655.    $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h
  656. cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
  657.   cp-lex.h cp-decl.h stack.h
  658. cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
  659.   cp-lex.h cp-decl.h
  660. cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  661. cp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  662. cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h \
  663.     cp-class.h flags.h
  664. cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h cp-class.h \
  665.     flags.h
  666. cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  667. cp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H)
  668. cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
  669. cp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
  670. cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  671. cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H)
  672. cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  673. cp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
  674. cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \
  675.   expr.h insn-codes.h
  676. cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
  677. cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H)
  678. cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h
  679.  
  680. collect2 : collect2.o version.o $(LIBDEPS)
  681.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
  682.  
  683. collect2.o : collect2.c $(CONFIG_H) gstab.h
  684.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  685.   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  686.   -DSTANDARD_BIN_PREFIX=\"$(bindir)/\" \
  687.   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  688.   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  689.   -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
  690.  
  691. # Objectionable C language specific files.
  692.  
  693. objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
  694.    c-tree.h input.h flags.h objc-actions.h
  695.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
  696. $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
  697.     cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
  698.  
  699. objc-actions.o : objc-actions.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h \
  700.    flags.h objc-actions.h
  701.  
  702. # A file used by all variants of C.
  703.  
  704. c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
  705.  
  706. # Language-independent files.
  707.  
  708. gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
  709.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  710.   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  711.   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  712.   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  713.   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
  714.  
  715. dumpvers: dumpvers.c
  716.  
  717. version.o: version.c
  718. obstack.o: obstack.c
  719.  
  720. tree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h
  721. print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
  722. stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
  723. fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h 
  724. toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
  725.    insn-attr.h xcoffout.h
  726.  
  727. rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
  728.  
  729. print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
  730. rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
  731.  
  732. varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h \
  733.    insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h
  734. function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
  735.    insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
  736.    recog.h output.h
  737. stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
  738.    insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h recog.h
  739. expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) gvarargs.h flags.h function.h  \
  740.    insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h typeclass.h
  741. calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
  742.    insn-flags.h
  743. expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
  744.    insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
  745. explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
  746.    insn-config.h expr.h recog.h insn-flags.h insn-codes.h
  747. optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
  748.    insn-flags.h insn-config.h insn-codes.h expr.h recog.h
  749. dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
  750.    insn-config.h reload.h gstab.h xcoffout.h
  751. sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
  752.    insn-config.h reload.h
  753. dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
  754.    insn-config.h reload.h output.h
  755. xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
  756. emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h  \
  757.    regs.h insn-config.h insn-codes.h real.h expr.h
  758. getpwd.o : getpwd.c $(CONFIG_H)
  759.  
  760. integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
  761.    insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h
  762.  
  763. jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
  764.    insn-config.h insn-flags.h insn-codes.h expr.h real.h
  765. stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
  766.  
  767. cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
  768.    insn-config.h recog.h
  769. loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
  770.    insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
  771. unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
  772.    integrate.h regs.h flags.h expr.h loop.h
  773. flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
  774.    basic-block.h regs.h hard-reg-set.h output.h
  775. combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h  \
  776.    insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
  777.    basic-block.h recog.h real.h
  778. regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
  779.    basic-block.h regs.h insn-config.h recog.h 
  780. local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
  781.    regs.h hard-reg-set.h insn-config.h recog.h output.h
  782. global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h  \
  783.    basic-block.h regs.h hard-reg-set.h insn-config.h output.h
  784.  
  785. reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
  786.    reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
  787. reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
  788.    reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
  789.    basic-block.h recog.h output.h
  790. caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
  791.    regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
  792. reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
  793.    basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
  794.    flags.h output.h
  795. sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
  796.    flags.h insn-config.h insn-attr.h
  797. final.o : final.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h regs.h \
  798.    recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
  799.    hard-reg-set.h insn-codes.h gstab.h xcoffout.h
  800. recog.o : recog.c $(CONFIG_H) $(RTL_H)  \
  801.    regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
  802.    insn-flags.h insn-codes.h real.h
  803. reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
  804.    regs.h hard-reg-set.h flags.h insn-config.h
  805.    
  806. aux-output.o : aux-output.c $(CONFIG_H) \
  807.    $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
  808.    insn-flags.h output.h insn-attr.h insn-codes.h
  809.  
  810. # Normally this target is not used; but it is used if you
  811. # define ALLOCA=alloca.o.  In that case, you must get a suitable alloca.c
  812. # from the GNU Emacs distribution.
  813. # Note some machines won't allow $(CC) without -S on this source file.
  814. alloca.o:    alloca.c
  815. # sed is used to strip the comments from the assembler output.
  816.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
  817.       `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
  818.     $(ALLOCA_FINISH)
  819.     -rm alloca.s
  820.  
  821. # Generate header and source files from the machine description, 
  822. # and compile them.
  823.  
  824. .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
  825.   insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
  826.   insn-attr.h insn-attrtab.c
  827.  
  828. # The following pair of rules has this effect:
  829. # genconfig is run only if the md has changed since genconfig was last run;
  830. # but the file insn-config.h is touched only when its contents actually change.
  831.  
  832. # Each of the other insn-* files is handled by a similar pair of rules.
  833.  
  834. # Each of the insn-*.[ch] rules has a semicolon at the end,
  835. # for otherwise the system Make on SunOS 4.1 never tries
  836. # to recompile insn-*.o.
  837.  
  838. insn-config.h: stamp-config ;
  839. stamp-config : md genconfig $(srcdir)/move-if-change
  840.     ./genconfig md > tmp-config.h
  841.     $(srcdir)/move-if-change tmp-config.h insn-config.h
  842.     touch stamp-config
  843.  
  844. insn-flags.h: stamp-flags ;
  845. stamp-flags : md genflags $(srcdir)/move-if-change
  846.     ./genflags md > tmp-flags.h
  847.     $(srcdir)/move-if-change tmp-flags.h insn-flags.h
  848.     touch stamp-flags
  849.  
  850. insn-codes.h: stamp-codes ;
  851. stamp-codes : md gencodes $(srcdir)/move-if-change
  852.     ./gencodes md > tmp-codes.h
  853.     $(srcdir)/move-if-change tmp-codes.h insn-codes.h
  854.     touch stamp-codes
  855.  
  856. insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
  857.   insn-config.h insn-flags.h insn-codes.h
  858.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
  859.  
  860. insn-emit.c: stamp-emit ;
  861. stamp-emit : md genemit $(srcdir)/move-if-change
  862.     ./genemit md > tmp-emit.c
  863.     $(srcdir)/move-if-change tmp-emit.c insn-emit.c
  864.     touch stamp-emit
  865.  
  866. insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
  867.   real.h output.h flags.h
  868.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
  869.  
  870. insn-recog.c: stamp-recog ;
  871. stamp-recog : md genrecog $(srcdir)/move-if-change
  872.     ./genrecog md > tmp-recog.c
  873.     $(srcdir)/move-if-change tmp-recog.c insn-recog.c
  874.     touch stamp-recog
  875.  
  876. insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
  877.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
  878.  
  879. insn-extract.c: stamp-extract ;
  880. stamp-extract : md genextract $(srcdir)/move-if-change
  881.     ./genextract md > tmp-extract.c
  882.     $(srcdir)/move-if-change tmp-extract.c insn-extract.c
  883.     touch stamp-extract
  884.  
  885. insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
  886.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
  887.  
  888. insn-peep.c: stamp-peep ;
  889. stamp-peep : md genpeep $(srcdir)/move-if-change
  890.     ./genpeep md > tmp-peep.c
  891.     $(srcdir)/move-if-change tmp-peep.c insn-peep.c
  892.     touch stamp-peep
  893.  
  894. insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
  895.      insn-attr.h insn-config.h
  896.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
  897.  
  898. insn-attr.h: stamp-attr ;
  899. stamp-attr : md genattr $(srcdir)/move-if-change
  900.     ./genattr md > tmp-attr.h
  901.     $(srcdir)/move-if-change tmp-attr.h insn-attr.h
  902.     touch stamp-attr
  903.  
  904. insn-attrtab.c: stamp-attrtab ;
  905. stamp-attrtab : md genattrtab $(srcdir)/move-if-change
  906.     ./genattrtab md > tmp-attrtab.c
  907.     $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
  908.     touch stamp-attrtab
  909.  
  910. insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
  911.     hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
  912.     insn-codes.h
  913.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
  914.  
  915. insn-output.c: stamp-output ;
  916. stamp-output : md genoutput $(srcdir)/move-if-change
  917.     ./genoutput md > tmp-output.c
  918.     $(srcdir)/move-if-change tmp-output.c insn-output.c
  919.     touch stamp-output
  920.  
  921. # Compile the programs that generate insn-* from the machine description.
  922. # They are compiled with $(HOST_CC), and associated libraries,
  923. # since they need to run on this machine
  924. # even if GCC is being compiled to run on some other machine.
  925.  
  926. # $(CONFIG_H) is omitted from the deps of the gen*.o
  927. # because these programs don't really depend on anything 
  928. # about the target machine.  They do depend on config.h itself,
  929. # since that describes the host machine.
  930.  
  931. genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
  932.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
  933.       genconfig.o $(HOST_RTL) $(HOST_LIBS)
  934.  
  935. genconfig.o : genconfig.c $(RTL_H) config.h
  936.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
  937.  
  938. genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
  939.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
  940.      genflags.o $(HOST_RTL) $(HOST_LIBS)
  941.  
  942. genflags.o : genflags.c $(RTL_H) config.h
  943.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
  944.  
  945. gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
  946.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
  947.      gencodes.o $(HOST_RTL) $(HOST_LIBS)
  948.  
  949. gencodes.o : gencodes.c $(RTL_H) config.h
  950.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
  951.  
  952. genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
  953.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
  954.      genemit.o $(HOST_RTL) $(HOST_LIBS)
  955.  
  956. genemit.o : genemit.c $(RTL_H) config.h
  957.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
  958.  
  959. genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
  960.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
  961.      genrecog.o $(HOST_RTL) $(HOST_LIBS)
  962.  
  963. genrecog.o : genrecog.c $(RTL_H) config.h
  964.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
  965.  
  966. genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
  967.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
  968.      genextract.o $(HOST_RTL) $(HOST_LIBS)
  969.  
  970. genextract.o : genextract.c $(RTL_H) config.h
  971.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
  972.  
  973. genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
  974.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
  975.      genpeep.o $(HOST_RTL) $(HOST_LIBS)
  976.  
  977. genpeep.o : genpeep.c $(RTL_H) config.h
  978.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
  979.  
  980. genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
  981.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
  982.      genattr.o $(HOST_RTL) $(HOST_LIBS)
  983.  
  984. genattr.o : genattr.c $(RTL_H) config.h
  985.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
  986.  
  987. genattrtab : genattrtab.o $(HOST_RTL) $(HOST_RTLANAL) $(HOST_LIBDEPS)
  988.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
  989.      genattrtab.o $(HOST_RTL) $(HOST_RTLANAL) $(HOST_LIBS)
  990.  
  991. genattrtab.o : genattrtab.c $(RTL_H) config.h insn-config.h
  992.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
  993.  
  994. genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
  995.     $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
  996.      genoutput.o $(HOST_RTL) $(HOST_LIBS)
  997.  
  998. genoutput.o : genoutput.c $(RTL_H) config.h
  999.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
  1000.  
  1001. # Compile the libraries to be used by gen*.
  1002. # If we are not cross-building, gen* use the same .o's that cc1 will use,
  1003. # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
  1004. # with the rules for rtl.o, alloca.o, etc.
  1005. $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
  1006.     rm -f $(HOST_PREFIX)rtl.c
  1007.     cp $(srcdir)/rtl.c $(HOST_PREFIX)rtl.c
  1008.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
  1009.  
  1010. $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
  1011.     rm -f $(HOST_PREFIX)rtlanal.c
  1012.     cp $(srcdir)/rtlanal.c $(HOST_PREFIX)rtlanal.c
  1013.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
  1014.  
  1015. $(HOST_PREFIX_1)alloca.o: alloca.c
  1016.     rm -f $(HOST_PREFIX)alloca.c
  1017.     cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
  1018.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
  1019.  
  1020. $(HOST_PREFIX_1)obstack.o: obstack.c
  1021.     rm -f $(HOST_PREFIX)obstack.c
  1022.     cp $(srcdir)/obstack.c $(HOST_PREFIX)obstack.c
  1023.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
  1024.  
  1025. $(HOST_PREFIX_1)malloc.o: malloc.c
  1026.     rm -f $(HOST_PREFIX)malloc.c
  1027.     cp $(srcdir)/malloc.c $(HOST_PREFIX)malloc.c
  1028.     $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
  1029.  
  1030. # This satisfies the dependency that we get if you cross-compile a compiler
  1031. # that does not need to compile alloca, malloc or whatever.
  1032. $(HOST_PREFIX_1): 
  1033.     touch $(HOST_PREFIX_1)
  1034.  
  1035. # Remake cpp and protoize.
  1036.  
  1037. # Making the preprocessor
  1038. cpp: cccp
  1039.     -rm -f cpp
  1040.     ln cccp cpp
  1041. cccp: cccp.o cexp.o version.o $(LIBDEPS)
  1042.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
  1043. cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
  1044.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
  1045. $(srcdir)/cexp.c: $(srcdir)/cexp.y
  1046.     cd $(srcdir); $(BISON) -o cexp.c cexp.y
  1047. cccp.o: cccp.c $(CONFIG_H) pcp.h version.c
  1048. # The reason we use $(libdir)/g++-include rather than using libsubdir
  1049. # is for compatibility with the current version of libg++.
  1050.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  1051.       -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
  1052.       -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
  1053.       -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
  1054.       -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
  1055.       -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
  1056.  
  1057. proto: config.status protoize unprotoize SYSCALLS.c.X protoize.1 unprotoize.1
  1058.  
  1059. protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
  1060.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
  1061.       protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
  1062. protoize.o:    $(srcdir)/protoize.c getopt.h $(CONFIG_H)
  1063.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  1064.           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
  1065.           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
  1066.           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
  1067.       -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
  1068.       -DSTD_PROTO_DIR=\"$(libsubdir)\" \
  1069.       $(srcdir)/protoize.c
  1070.  
  1071. unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
  1072.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
  1073.       unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
  1074. unprotoize.o:    $(srcdir)/protoize.c getopt.h $(CONFIG_H)
  1075.     cp $(srcdir)/protoize.c unprotoize.c
  1076.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  1077.           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
  1078.           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
  1079.           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
  1080.       -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
  1081.       -DSTD_PROTO_DIR=\"$(libsubdir)\" \
  1082.       -DUNPROTOIZE unprotoize.c
  1083.     rm -f unprotoize.c
  1084.  
  1085. getopt.o: $(srcdir)/getopt.c getopt.h
  1086.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
  1087. getopt1.o: $(srcdir)/getopt1.c getopt.h
  1088.     $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
  1089.  
  1090. protoize.1:    $(srcdir)/proto-man ./cpp
  1091.     ./cpp -traditional $(srcdir)/proto-man \
  1092.         | grep -v '^#' \
  1093.             | awk 'NF > 0 {print}' > tmp-proto.1
  1094.     mv tmp-proto.1 protoize.1
  1095.  
  1096. unprotoize.1:    $(srcdir)/proto-man ./cpp
  1097.     ./cpp -traditional -DUNPRO $(srcdir)/proto-man \
  1098.         | grep -v '^#' \
  1099.             | awk 'NF > 0 {print}' > tmp-unproto.1
  1100.     mv tmp-unproto.1 unprotoize.1
  1101.  
  1102. SYSCALLS.c : $(srcdir)/sys-types.h $(srcdir)/sys-protos.h
  1103.     cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h >$@
  1104.  
  1105. # This info describes the target machine, so compile with GCC just built.
  1106. SYSCALLS.c.X:    SYSCALLS.c $(GCC_PASSES)
  1107.     $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  1108.       -aux-info $@ -S -o /dev/null SYSCALLS.c
  1109.  
  1110. # Remake the info files.
  1111.  
  1112. doc: $(srcdir)/cpp.info $(srcdir)/gcc.info
  1113.  
  1114. $(srcdir)/cpp.info: $(srcdir)/cpp.texi
  1115.     makeinfo `echo $(srcdir)/cpp.texi | sed 's,^\./,,'`
  1116.  
  1117. #$(srcdir)/gplus.info: $(srcdir)/gplus.texi
  1118. #    makeinfo `echo $(srcdir)/gplus.texi | sed 's,^\./,,'`
  1119.  
  1120. $(srcdir)/gcc.info: $(srcdir)/gcc.texi
  1121.     makeinfo `echo $(srcdir)/gcc.texi | sed 's,^\./,,'`
  1122.  
  1123. # Deletion of files made during compilation.
  1124. # There are four levels of this:
  1125. #   `mostlyclean', `clean', `cleanconfig' and `realclean'.
  1126. # `mostlyclean' is useful while working on a particular type of machine.
  1127. # It deletes most, but not all, of the files made by compilation.
  1128. # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
  1129. # `clean' deletes everything made by running `make all'.
  1130. # `cleanconfig' also deletes the files made by config.
  1131. # `realclean' also deletes everything that could be regenerated automatically.
  1132.  
  1133. mostlyclean:
  1134.     -rm -f $(STAGESTUFF)
  1135. # Delete the temporary source copies for cross compilation.
  1136.     -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
  1137.     -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
  1138.     -rm -f $(HOST_PREFIX_1)obstack.c 
  1139. # Delete the temp files made in the course of building libgcc.a.
  1140.     -rm -f tmplibgcc* tmpcopy
  1141.     for name in $(LIB1FUNCS); do rm -f $${name}.c; done
  1142. # Delete other temporary files.
  1143.     -rm -f tmp-float.h tmp-*proto.1 tmp-gcc.xtar.Z tmp-limits.h gccnew
  1144. # Delete the stamp files.
  1145.     -rm -f stamp-* tmp-*
  1146. # Delete debugging dump files.
  1147.     -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
  1148.     -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
  1149. # Delete some files made during installation.
  1150.     -rm -f specs float.h enquire SYSCALLS.c SYSCALLS.c.X
  1151.     -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
  1152. # Delete unwanted output files from TeX.
  1153.     -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
  1154. # Delete sorted indices we don't actually use.
  1155.     -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
  1156. # Delete core dumps.
  1157.     -rm -f core
  1158.  
  1159. # delete all files made by compilation.
  1160. clean: mostlyclean
  1161.     -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready
  1162.     -rm -fr stage1 stage2 stage3 stage4
  1163.  
  1164. # This is used to get rid of everything found in the source dir
  1165. # that shouldn't be in the distribution.
  1166. distclean: clean
  1167.     -rm -f tm.h aux-output.c config.h md config.status tconfig.h
  1168.     -rm -f Makefile *.dvi *.oaux
  1169.  
  1170. # Delete anything likely to be found in the source directory
  1171. # that shouldn't be in the distribution.
  1172. extraclean: distclean
  1173.     -rm -rf =* #* *~* config/=* config/#* config/*~*
  1174.     -rm -f *.dvi *.oaux patch* *.orig *.rej *.d *.Z *.tar
  1175.     -rm -f *.s *.s[0-9] *.i
  1176.  
  1177. # Get rid of every file that's generated from some other file.
  1178. # Most of these files ARE PRESENT in the GCC distribution.
  1179. realclean: distclean
  1180.     -rm -f cp-parse.c cp-parse.h cp-parse.output
  1181.     -rm -f objc-parse.c objc-parse.output
  1182.     -rm -f protoize.1 unprotoize.1
  1183.     -rm -f c-parse.c c-parse.h c-parse.output
  1184.     -rm -f cexp.c cexp.output TAGS 
  1185.     -rm -f cpp.info* cpp.??s cpp.*aux
  1186.     -rm -f gcc.info* gcc.??s gcc.*aux
  1187.     -rm -f gplus.info* gplus.??s gplus.*aux
  1188.  
  1189. # Entry points `install' and `uninstall'.
  1190. # Also temporarily `install-fixincludes' could replace `install-headers'.
  1191. # Also use `install-collect2' to install collect2 when the config files don't.
  1192.  
  1193. install: $(INSTALL_TARGET)
  1194.  
  1195. # Copy the files of native compiler into directories where they will be run.
  1196. install-native: install-common install-libgcc $(INSTALL_HEADERS) \
  1197.    install-man
  1198.  
  1199. # Copy the files of cross compiler into directories where they will be run.
  1200. install-cross: install-common install-common-headers \
  1201.    install-man install-cross-tools install-libgcc
  1202.  
  1203. # Install the tools, libraries and header files for the target machine
  1204. # where cross-compilation will look for them.
  1205. # Use tooldir to find them.
  1206. install-cross-tools: install-dir
  1207. # The first if makes this a no-op except for a cross compiler.
  1208. # The /. after the dirname causes test to follow symlinks.
  1209. # Before making a link or an indirection script, 
  1210. # we verify the desired file does not already exist.
  1211. # If a symlink does exist, then making a symlink would certainly fail, 
  1212. # leading us to overwrite the real file through the symlink.
  1213.     -if [ -f gcc-cross ] ; \
  1214.     then \
  1215.       if [ -d $(tooldir)/. ] ; \
  1216.       then \
  1217.         for file in as ld ar ranlib; do \
  1218.           if [ -f $(libsubdir)/$$file ] ; \
  1219.           then true; \
  1220.           else  \
  1221.         $(SYMLINK) $(tooldir)/bin/$$file $(libsubdir)/$$file \
  1222.         || (echo "#!/bin/sh"; echo $(tooldir)/bin/$$file "$$@") > $(libsubdir)/$$file; \
  1223.           fi; \
  1224.         done; \
  1225.         for file in $(tooldir)/lib/*; do \
  1226.           if [ -f $$file ] ; \
  1227.           then \
  1228.         if [ -f $(libsubdir)/`basename $$file` ] ; \
  1229.         then true; \
  1230.         else  \
  1231.           $(SYMLINK) $$file $(libsubdir)/`basename $$file` \
  1232.           || $(INSTALL_DATA) $$file $(libsubdir)/`basename $$file`; \
  1233.         fi; \
  1234.           else true; \
  1235.           fi; \
  1236.         done; \
  1237.         if [ -d $(tooldir)/include/. ] ; then \
  1238.           $(SYMLINK) $(tooldir)/include $(libsubdir)/sys-include \
  1239.           || (if [ -d $(libsubdir)/sys-include ] ; then true ; else mkdir $(libsubdir)/sys-include ; fi; \
  1240.           cd $(tooldir)/include; tar cf - . | (cd $(libsubdir)/sys-include; tar xpf -)); \
  1241.         else true; fi; \
  1242.       else true; \
  1243.       fi; \
  1244.     else true; \
  1245.     fi;
  1246.  
  1247. # Run this on the target machine
  1248. # to finish installation of cross compiler.
  1249. install-cross-rest: install-float-h-cross
  1250.  
  1251. # Install float.h for cross compiler.
  1252. # Run this on the target machine!
  1253. install-float-h-cross:
  1254.     if [ -f enquire ] ; then true; else false; done
  1255.     -./enquire -f > float.h
  1256.     -rm -f $(libsubdir)/include/float.h
  1257.     $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
  1258.     chmod a-x $(libsubdir)/include/float.h
  1259.  
  1260. # Create the installation directory.
  1261. install-dir:
  1262.     if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
  1263.     if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi
  1264.     if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi
  1265.     if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi
  1266.     if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
  1267. # We don't use mkdir -p to create the parents of mandir,
  1268. # because some systems don't support it.
  1269. # Instead, we use this technique to create the immediate parent of mandir.
  1270.     parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
  1271.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  1272.     -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi
  1273.  
  1274. # Install the compiler executables built during cross compilation.
  1275. install-common: native install-dir
  1276.     for file in $(COMPILERS); do \
  1277.       if [ -f $$file ] ; then \
  1278.         rm -f $(libsubdir)/$$file; \
  1279.         $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
  1280.       else true; \
  1281.       fi; \
  1282.     done
  1283.     for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) ..; do \
  1284.       if [ x"$$file" != x.. ]; then \
  1285.         rm -f $(libsubdir)/$$file; \
  1286.         $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
  1287.       else true; fi; \
  1288.     done
  1289.     -rm -f $(libsubdir)/specs
  1290.     $(INSTALL_DATA) specs $(libsubdir)/specs
  1291. # Install the driver program as gcc-$(target)
  1292. # and also as either gcc (if native) or $(tooldir)/bin/gcc.
  1293.     -if [ -f gcc-cross ] ; then \
  1294.       $(INSTALL_PROGRAM) gcc-cross $(bindir)/gcc-$(target); \
  1295.       if [ -d $(tooldir)/bin/. ] ; then \
  1296.         rm -f $(tooldir)/bin/gcc; \
  1297.         $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \
  1298.       else true; fi; \
  1299.     else \
  1300.       rm -f $(bindir)/gcc; \
  1301.       $(INSTALL_PROGRAM) gcc $(bindir)/gcc; \
  1302.       rm -f $(bindir)/gcc-$(target)-1; \
  1303.       ln $(bindir)/gcc $(bindir)/gcc-$(target)-1; \
  1304.       mv $(bindir)/gcc-$(target)-1 $(bindir)/gcc-$(target); \
  1305.     fi
  1306.     $(INSTALL_PROGRAM) $(srcdir)/c++ $(bindir)/c++
  1307.     $(INSTALL_PROGRAM) $(srcdir)/g++ $(bindir)/g++
  1308.     -rm -f $(libsubdir)/cpp
  1309.     $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
  1310.  
  1311. # Install protoize.
  1312. install-proto: proto install-dir
  1313.     -rm -f $(bindir)/protoize
  1314.     $(INSTALL_PROGRAM) protoize $(bindir)/protoize
  1315.     -rm -f $(bindir)/unprotoize
  1316.     $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize
  1317.     -rm -f $(libsubdir)/SYSCALLS.c.X
  1318.     $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X
  1319.     chmod a-x $(libsubdir)/SYSCALLS.c.X
  1320.  
  1321. # Install the man pages.
  1322. install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 \
  1323.    protoize.1 unprotoize.1 $(srcdir)/g++.1
  1324.     -rm -f $(mandir)/gcc$(manext)
  1325.     $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/gcc$(manext)
  1326.     chmod a-x $(mandir)/gcc$(manext)
  1327.     -rm -f $(mandir)/cccp$(manext)
  1328.     $(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
  1329.     chmod a-x $(mandir)/cccp$(manext)
  1330.     -rm -f $(mandir)/protoize$(manext)
  1331.     $(INSTALL_DATA) protoize.1 $(mandir)/protoize$(manext)
  1332.     chmod a-x $(mandir)/protoize$(manext)
  1333.     -rm -f $(mandir)/unprotoize$(manext)
  1334.     $(INSTALL_DATA) unprotoize.1 $(mandir)/unprotoize$(manext)
  1335.     chmod a-x $(mandir)/unprotoize$(manext)
  1336.     -rm -f $(mandir)/g++$(manext)
  1337.     $(INSTALL_DATA) $(srcdir)/g++.1 $(mandir)/g++$(manext)
  1338.     chmod a-x $(mandir)/g++$(manext)
  1339.  
  1340. # Install the library.
  1341. install-libgcc: libgcc.a
  1342.     -if [ -f libgcc.a ] ; then \
  1343.       rm -f $(libsubdir)/libgcc.a; \
  1344.       $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
  1345.       if $(RANLIB_TEST) ; then \
  1346.         (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
  1347.       chmod a-x $(libsubdir)/libgcc.a; \
  1348.     else true; fi
  1349.  
  1350. # Install all the header files for native compiler.
  1351. install-headers: install-common-headers install-float-h install-limits-h
  1352.  
  1353. # Install float.h for native compiler.
  1354. install-float-h: float.h
  1355.     -rm -f $(libsubdir)/include/float.h
  1356.     $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
  1357.     chmod a-x $(libsubdir)/include/float.h
  1358.  
  1359. # Install limits.h, optionally inheriting from the standard system version.
  1360. install-limits-h: limits.h limitx.h
  1361.     -rm -f $(libsubdir)/include/limits.h tmp-limits.h
  1362.     if [ -f /usr/include/limits.h ] ; then \
  1363.       cat $(srcdir)/limitx.h $(srcdir)/limits.h > tmp-limits.h; \
  1364.     else \
  1365.       cat $(srcdir)/limits.h > tmp-limits.h; \
  1366.     fi
  1367.     $(INSTALL_DATA) tmp-limits.h $(libsubdir)/include/limits.h
  1368.     chmod a-x $(libsubdir)/include/limits.h
  1369.     rm tmp-limits.h
  1370.  
  1371. # Install the fixed headers that are the same for all machines.
  1372. install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h
  1373.     if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
  1374.     -chmod ugo+rx $(libsubdir)/include
  1375. # Must compute $(libsubdir) before the cd; the awk script won't work after.
  1376.     shelllibsubdir=$(libsubdir); \
  1377.     cd $(srcdir); \
  1378.     for file in $(USER_H); do \
  1379.        rm -f $$shelllibsubdir/include/`basename $$file`; \
  1380.        $(INSTALL_DATA) `basename $$file` $$shelllibsubdir/include/`basename $$file`; \
  1381.        chmod a-x $$shelllibsubdir/include/`basename $$file`; \
  1382.     done
  1383.     -rm -f $(libsubdir)/include/varargs.h
  1384.     $(INSTALL_DATA) $(srcdir)/gvarargs.h $(libsubdir)/include/varargs.h
  1385.     chmod a-x $(libsubdir)/include/varargs.h
  1386.     -rm -f $(libsubdir)/include/stdarg.h
  1387.     $(INSTALL_DATA) $(srcdir)/gstdarg.h $(libsubdir)/include/stdarg.h
  1388.     chmod a-x $(libsubdir)/include/stdarg.h
  1389.     -rm -f $(libsubdir)/include/stddef.h
  1390.     $(INSTALL_DATA) $(srcdir)/gstddef.h $(libsubdir)/include/stddef.h
  1391.     chmod a-x $(libsubdir)/include/stddef.h
  1392. # Copy byteorder.h into the object file directory 
  1393. # so that fixinc.svr4 can get at it if necessary.
  1394. # If the dirs are the same, this won't do anything.
  1395.     -cp $(srcdir)/byteorder.h .
  1396.  
  1397. # $(libsubdir)/include:
  1398. #    if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
  1399. #    -chmod ugo+rx $(libsubdir)/include
  1400.  
  1401. # This appears not to work.  It isn't clear how to fix it.
  1402. # $(libsubdir)/include/README: $(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
  1403. #    LIB=$(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
  1404. #    $(INSTALL_DATA) $(srcdir)/fixincludes-README $@
  1405. #    chmod a-x $@
  1406.  
  1407. # Run fixincludes in the proper directory.
  1408. install-fixincludes: install-headers
  1409.     rm -rf $(libsubdir)/tmp
  1410.     mkdir $(libsubdir)/tmp
  1411. # Move aside the headers that come from GCC; delete all else.
  1412. # The sed command gets just the last file name component;
  1413. # this is necessary because VPATH could add a dirname.
  1414. # Using basename would be simpler, but some systems don't have it.
  1415.     cd $(libsubdir)/include; \
  1416.     for file in $(INSTALLED_H); do \
  1417.       realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
  1418.       mv $$realfile ../tmp; \
  1419.     done; \
  1420.     rm -rf *
  1421. # Install fixed copies of system files.
  1422.     $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include
  1423. # Bring back gcc's header files.
  1424.     cd $(libsubdir)/include; mv ../tmp/* .; rmdir ../tmp
  1425. # Install the README
  1426.     $(INSTALL_DATA) $(srcdir)/README-fixinc $(libsubdir)/include/README
  1427.     chmod a-x $(libsubdir)/include/README
  1428.  
  1429. # Use this target to install the program `collect2' under the name `ld'.
  1430. install-collect2: collect2
  1431.     $(INSTALL_PROGRAM) collect2 $(libsubdir)/ld
  1432. # Install the driver program as $(libsubdir)/gcc for collect2.
  1433.     -if [ -f gcc-cross ] ; then \
  1434.       $(INSTALL_PROGRAM) gcc-cross $(libsubdir)/gcc; \
  1435.     else \
  1436.       $(INSTALL_PROGRAM) gcc $(libsubdir)/gcc; \
  1437.     fi
  1438.  
  1439. # Cancel installation by deleting the installed files.
  1440. uninstall:
  1441.     -rm -rf $(libsubdir)
  1442.     -rm -rf $(bindir)/gcc
  1443.     -rm -rf $(bindir)/protoize
  1444.     -rm -rf $(bindir)/unprotoize
  1445.     -rm -rf $(mandir)/gcc$(manext)
  1446.     -rm -rf $(mandir)/cccp$(manext)
  1447.     -rm -rf $(mandir)/protoize$(manext)
  1448.     -rm -rf $(mandir)/unprotoize$(manext)
  1449.  
  1450. # These exist for maintenance purposes.
  1451.  
  1452. # Update the tags table.
  1453. TAGS: force
  1454.     cd $(srcdir);                            \
  1455.     mkdir temp;                            \
  1456.     mv -f c-parse.c c-parse.h cp-parse.c cp-parse.h objc-parse.c cexp.c temp;    \
  1457.     etags *.y *.h *.c;                        \
  1458.     mv temp/* .;                            \
  1459.     rmdir temp
  1460.  
  1461. # Create the distribution tar file.
  1462. #dist: gcc-$(version).tar.Z
  1463. dist: gcc.xtar.Z
  1464.  
  1465. gcc.xtar.Z: gcc.xtar
  1466.     compress < gcc.xtar > tmp-gcc.xtar.Z
  1467.     mv tmp-gcc.xtar.Z gcc.xtar.Z
  1468.  
  1469. #gcc-$(version).tar.Z: gcc-$(version).tar
  1470. #    compress < gcc-$(version).tar > gcc-$(version).tar.Z
  1471.  
  1472. #gcc-$(version).tar:
  1473. gcc.xtar:
  1474.     -rm -rf gcc-$(version) tmp    
  1475. # Put all the files in a temporary subdirectory
  1476. # which has the name that we want to have in the tar file.
  1477.     mkdir tmp
  1478.     mkdir tmp/config
  1479.     for file in *[0-9a-zA-Z+]; do \
  1480.       ln $$file tmp || cp $$file tmp; \
  1481.     done
  1482.     cd config; \
  1483.     for file in *[0-9a-zA-Z+]; do \
  1484.       ln $$file ../tmp/config || cp $$file ../tmp/config; \
  1485.     done
  1486.     ln .gdbinit tmp
  1487.     mv tmp gcc-$(version)
  1488. # Get rid of everything we don't want in the distribution.
  1489.     cd gcc-$(version); make -f Makefile.in extraclean
  1490. # Make the distribution.
  1491.     tar chf gcc.xtar gcc-$(version)
  1492. # Get rid of the temporary directory.
  1493.     rm -rf gcc-$(version)
  1494.  
  1495. # do make -f ../gcc/Makefile maketest DIR=../gcc
  1496. # in the intended test directory to make it a suitable test directory.
  1497. # THIS IS OBSOLETE; use the -srcdir operand in configure instead. 
  1498. maketest:
  1499.     ln -s $(DIR)/*.[chy] .
  1500.     ln -s $(DIR)/configure .
  1501.     ln -s $(DIR)/*.def .
  1502.     -rm -f =*
  1503.     ln -s $(DIR)/.gdbinit .
  1504.     ln -s $(DIR)/$(FIXINCLUDES) .
  1505.     -ln -s $(DIR)/bison.simple .
  1506.     ln -s $(DIR)/config .
  1507.     ln -s $(DIR)/move-if-change .
  1508. # The then and else were swapped to avoid a problem on Ultrix.
  1509.     if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
  1510.     -rm tm.h aux-output.c config.h md
  1511.     make clean
  1512. # You must then run config to set up for compilation.
  1513.  
  1514. bootstrap: all force
  1515.     $(MAKE) stage1
  1516. # This used to define ALLOCA as empty, but that would lead to bad results
  1517. # for a subsequent `make install' since that would not have ALLOCA empty.
  1518. # To prevent `make install' from compiling alloca.o and then relinking cc1
  1519. # because alloca.o is newer, we permit these recursive makes to compile
  1520. # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
  1521.     $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  1522.     $(MAKE) stage2
  1523.     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  1524.  
  1525. bootstrap2: force
  1526.     $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  1527.     $(MAKE) stage2
  1528.     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  1529.  
  1530. bootstrap3: force
  1531.     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  1532.  
  1533. # Copy the object files from a particular stage into a subdirectory.
  1534. stage1: force
  1535.     -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
  1536.     -mv $(STAGESTUFF) stage1
  1537.     -rm -f stage1/libgcc.a
  1538.     -cp libgcc.a stage1
  1539.     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
  1540.  
  1541. stage2: force
  1542.     -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
  1543.     -mv $(STAGESTUFF) stage2
  1544.     -rm -f stage2/libgcc.a
  1545.     -cp libgcc.a stage2
  1546.     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
  1547.  
  1548. stage3: force
  1549.     if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
  1550.     -mv $(STAGESTUFF) stage3
  1551.     -rm -f stage3/libgcc.a
  1552.     -cp libgcc.a stage3
  1553.     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
  1554.  
  1555. stage4: force
  1556.     if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
  1557.     -mv $(STAGESTUFF) stage4
  1558.     -rm -f stage4/libgcc.a
  1559.     -cp libgcc.a stage4
  1560.     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
  1561.  
  1562. # Copy just the executable files from a particular stage into a subdirectory,
  1563. # and delete the object files.  Use this if you're just verifying a version
  1564. # that is pretty sure to work, and you are short of disk space.
  1565. risky-stage1: force
  1566.     if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
  1567.     -mv cc1 cpp cccp gcc stage1
  1568.     -rm -f stage1/libgcc.a
  1569.     -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
  1570.     -make clean
  1571.  
  1572. risky-stage2: force
  1573.     if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
  1574.     -mv cc1 cpp cccp gcc stage2
  1575.     -rm -f stage2/libgcc.a
  1576.     -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
  1577.     -make clean
  1578.  
  1579. risky-stage3: force
  1580.     if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
  1581.     -mv cc1 cpp cccp gcc stage3
  1582.     -rm -f stage3/libgcc.a
  1583.     -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
  1584.     -make clean
  1585.  
  1586. risky-stage4: force
  1587.     if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
  1588.     -mv cc1 cpp cccp gcc stage4
  1589.     -rm -f stage4/libgcc.a
  1590.     -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
  1591.     -make clean
  1592.  
  1593. #In GNU Make, ignore whether `stage*' exists.
  1594. .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
  1595. .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
  1596.  
  1597. force:
  1598.